<?php
declare (strict_types = 1);

namespace app\exception;

use think\Exception;
use Throwable;

class BusinessException extends Exception
{
    protected $statusCode = 400;
    protected $data = [];

    public function __construct(
        string $message = "",
        int $code = 400,
        array $data = [],
        Throwable $previous = null
    ) {
        parent::__construct($message, $code, $previous);
        $this->data = $data;
    }

    public function getStatusCode(): int
    {
        return $this->statusCode;
    }

}
